<% if @reference_class != "reference_all"%>

  <%= text_field_tag 'reference', params[:reference] %>
  <div class="auto_complete" id="reference_auto_complete" ></div>

  <%= auto_complete_field 'reference',
    :url=>{:action=>'auto_complete_reference'},
    :frequency => 0.5,
    :min_chars => 3,
    :with => "'reference_text=' + element.value + '&reference_class=#{@reference_class}'" %>

<% end %>